<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>后台管理系统</title>
    <link href="../../static/css/style.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/jsq.css" rel="stylesheet" type="text/css"/>
    <link href="../../static/css/index_work.css" rel="stylesheet" type="text/css"/>
    <script src='http://ajax.aspnetcdn.com/ajax/jquery/jquery-2.1.4.min.js'></script>
</head>
<style>



</style>
<body>
    <div>
        <path fill="#EDB36D" d="M0 0h34.7v77.62H0z"></path>
        <path d="M57.05 5.89a10.39 10.39 0 0 1 10.16 10.36v41.44a10.39 10.39 0 0 1-10.36 10.36H20.29l-.17-26.73h32.07l-.06-10.76H20.06l-.1-15h37.15z" fill="#cc6f00" fill-rule="evenodd"></path>
        <path d="M33.51-26.32C34.01-26.32 34.40-26.49 34.51-26.89C33.01-28.24 30.52-30.16 30.52-30.16L28.38-27.35L14.10-27.35L14.39-26.32ZM20.15-17.20L20.15-22.01L27.56-22.01L27.56-17.20ZM28.24-14.88C29.52-14.88 31.51-15.56 31.55-15.77L31.55-21.33C32.30-21.47 32.80-21.79 33.01-22.08L29.06-25.03L27.21-23.04L20.30-23.04L16.34-24.61L16.34-14.39L16.88-14.39C18.45-14.39 20.15-15.21 20.15-15.53L20.15-16.20L27.56-16.20L27.56-14.88ZM4.66-30.05C5.59-28.67 6.59-26.64 6.77-24.75C10.22-21.83 14.31-28.49 4.95-30.23ZM9.76-14.78C11.40-16.74 12.71-18.73 13.67-20.65C14.56-20.76 14.96-20.87 15.28-21.19L11.61-24.71L9.37-22.58L1.35-22.58L1.67-21.54L9.47-21.54C7.98-16.95 4.49-11.40 0.53-7.66L0.85-7.34C2.60-8.33 4.27-9.54 5.84-10.86L5.84 3.06L6.52 3.06C8.48 3.06 9.76 2.07 9.76 1.78L9.76-13.50C10.50-12.14 11.15-10.47 11.32-9.08C13.99-6.73 16.99-11.89 9.76-14.78ZM25.50-0.36L25.50-5.59L29.06-5.59L29.06-0.36ZM18.37-5.59L22.08-5.59L22.08-0.36L18.37-0.36ZM22.08-11.43L22.08-6.59L18.37-6.59L18.37-11.43ZM29.06-11.43L29.06-6.59L25.50-6.59L25.50-11.43ZM28.67-12.43L18.59-12.43L14.56-14.07L14.56 3.13L15.13 3.13C16.77 3.13 18.37 2.28 18.37 1.89L18.37 0.68L29.06 0.68L29.06 2.88L29.73 2.88C31.02 2.88 32.94 2.10 32.97 1.89L32.97-10.75C33.72-10.90 34.26-11.22 34.47-11.50L30.55-14.49ZM44.37-15.35L47.75-15.35C48.22-15.35 48.57-15.53 48.64-15.92C47.68-17.09 45.90-18.91 45.90-18.91L44.37-16.42L44.37-25.53L48.32-25.53C48.86-25.53 49.21-25.71 49.32-26.10C47.93-27.45 45.65-29.34 45.65-29.34L43.59-26.56L36.64-26.56L36.93-25.53L40.42-25.53L40.42-16.34L36.93-16.34L37.21-15.35L40.42-15.35L40.42-5.27C38.71-4.77 37.32-4.38 36.43-4.17L38.74 0.46C39.13 0.32 39.49-0.07 39.56-0.53C43.98-3.53 46.97-5.88 48.89-7.44L48.75-7.83C47.25-7.34 45.79-6.87 44.37-6.45ZM64.77-11.29L64.77-1.82C64.77-1.42 64.67-1.21 64.27-1.21C63.92-1.21 62.99-1.28 62.74-1.32L62.74-11.29ZM69.33-16.10C69.83-16.10 70.19-16.27 70.29-16.67C69.37-17.52 67.98-18.62 67.19-19.23C67.69-19.41 68.05-19.59 68.05-19.73L68.05-26.60C69.05-26.78 69.33-27.10 69.40-27.60L64.42-28.02L64.42-21.01L60.68-21.01L60.68-28.81C61.53-28.95 61.78-29.27 61.85-29.73L57.08-30.16L57.08-21.01L53.31-21.01L53.31-26.67C54.27-26.85 54.59-27.13 54.66-27.56L49.71-28.02L49.71-21.22C49.43-20.97 49.14-20.69 48.96-20.44L52.60-18.41L53.59-20.01L64.42-20.01L64.42-18.91L65.02-18.91C65.34-18.91 65.66-18.94 65.98-18.98L64.52-17.13L48.46-17.13L48.75-16.10L56.12-16.10C55.91-14.92 55.62-13.46 55.34-12.29L53.09-12.29L49.21-13.89L49.21 3.03L49.75 3.03C51.28 3.03 52.84 2.21 52.84 1.85L52.84-11.29L54.91-11.29L54.91 1.28L55.41 1.28C56.87 1.28 57.79 0.68 57.79 0.53L57.79-11.29L59.79-11.29L59.79 0.36L60.29 0.36C61.78 0.36 62.71-0.18 62.74-0.36L62.74-0.82C63.60-0.57 63.88-0.25 64.13 0.32C64.38 0.93 64.42 1.85 64.42 3.03C68.05 2.67 68.48 1.28 68.48-1.39L68.48-10.68C69.19-10.86 69.65-11.15 69.87-11.43L66.09-14.21L64.42-12.29L57.05-12.29C58.22-13.39 59.54-14.85 60.61-16.10ZM78.66-30.23C77.45-27.35 74.74-22.79 72.11-19.80L72.39-19.44C76.24-21.51 79.87-24.61 82.12-27.10C82.90-26.96 83.25-27.17 83.43-27.53ZM89.77-20.69L89.77-14.46L87.46-14.46L87.46-20.69ZM94.86-14.46L92.69-14.46L92.69-20.69L94.86-20.69ZM99.99-20.69L99.99-14.46L97.82-14.46L97.82-20.69ZM84.64-11.86C86.39-11.86 87.46-12.46 87.46-12.71L87.46-13.42L99.99-13.42L99.99-12.43L100.60-12.43C100.77-12.43 100.95-12.43 101.13-12.43L99.74-10.83L82.12-10.83L82.40-9.83L104.91-9.83C105.44-9.83 105.80-10.01 105.90-10.40C104.94-11.18 103.62-12.14 102.77-12.75C103.27-12.93 103.55-13.14 103.55-13.21L103.55-20.44C104.30-20.58 104.62-20.80 104.87-21.08L101.52-23.57L99.88-21.69L94.65-21.69C94.86-22.61 95.08-23.75 95.29-24.89L104.91-24.89C105.44-24.89 105.80-25.07 105.87-25.46C104.41-26.81 101.95-28.74 101.95-28.74L99.78-25.92L95.50-25.92L95.93-28.20C96.72-28.24 97.21-28.52 97.39-29.06L91.91-30.30C91.73-28.99 91.52-27.42 91.27-25.92L82.22-25.92L82.51-24.89L91.12-24.89C90.95-23.68 90.73-22.61 90.59-21.69L87.85-21.69L84.04-23.18L84.04-11.86ZM80.23-16.13C81.15-17.41 82.01-18.62 82.65-19.76C83.54-19.69 83.86-19.91 84.04-20.30L78.73-22.83C77.63-18.80 74.99-12.71 72.04-8.65L72.36-8.33C73.89-9.40 75.31-10.58 76.60-11.89L76.60 3.13L77.34 3.13C79.05 3.13 80.62 2.14 80.66 1.74L80.66-14.92C81.30-15.03 81.62-15.24 81.76-15.56ZM91.59-9.37C92.69-7.91 93.58-5.59 93.47-3.63C96.54-0.78 100.42-7.16 91.94-9.54ZM84.54-7.80C84.68-6.16 83.47-4.24 82.54-3.49C81.51-2.81 80.90-1.74 81.47-0.53C82.08 0.75 84.07 0.82 84.89-0.14C86.00-1.46 86.32-4.13 85.07-7.76ZM99.85-4.74L99.46-4.74C98.92-3.17 98.46-1.92 98.18-1.53C97.96-1.25 97.75-1.18 97.32-1.14L94.79-1.14L91.87-1.14C90.88-1.14 90.73-1.25 90.73-1.67L90.73-7.02C91.44-7.12 91.77-7.44 91.84-7.87L87.21-8.30L87.21-0.85C87.21 1.53 87.78 2.21 91.02 2.21L94.44 2.21C99.78 2.21 101.17 1.50 101.17 0C101.17-0.64 100.95-1.07 99.99-1.42ZM99.14-7.83C100.60-6.05 102.06-3.28 102.27-0.93C105.76 1.85 109.07-5.34 99.49-8.08ZM122.03-4.17L122.03-9.65L126.84-9.65L126.84-4.17ZM130.58-9.22C131.11-9.29 131.54-9.58 131.72-9.79L129.90-11.15C133.46-9.19 135.74-15.99 125.95-17.31L125.63-17.06C127.23-15.60 129.19-13.21 129.87-11.18L128.23-12.43L126.52-10.65L122.18-10.65L119.33-11.79C120.64-12.75 121.96-13.89 123.14-15.06C123.89-14.88 124.42-15.17 124.60-15.53L120.11-17.91C118.72-14.88 116.83-11.79 115.41-9.90L115.84-9.54C116.62-9.97 117.48-10.50 118.33-11.07L118.33-0.71L118.86-0.71C120.40-0.71 122.03-1.53 122.03-1.85L122.03-3.13L126.84-3.13L126.84-1.39L127.48-1.39C128.66-1.39 130.54-2.07 130.58-2.28ZM133.54-19.26L128.51-19.26C130.01-20.37 131.47-21.69 132.54-22.72C133.36-22.72 133.75-23.04 133.89-23.47L128.34-24.75C128.05-23.15 127.52-20.90 126.98-19.26L120.82-19.26C122.67-20.15 122.85-23.68 116.51-24.61L116.19-24.39C117.05-23.22 118.01-21.40 118.22-19.69C118.47-19.51 118.69-19.37 118.94-19.26L115.23-19.26L110.82-21.05L110.82 3.13L111.49 3.13C113.20 3.13 114.91 2.21 114.91 1.74L114.91-18.27L133.89-18.27L133.89-1.85C133.89-1.39 133.75-1.14 133.14-1.14C132.36-1.14 129.16-1.39 129.16-1.39L129.16-0.89C130.83-0.64 131.54-0.14 132.08 0.43C132.54 1.03 132.68 1.96 132.79 3.24C137.42 2.81 138.02 1.25 138.02-1.46L138.02-17.56C138.73-17.70 139.27-18.05 139.48-18.34L135.42-21.44ZM134.46-25.82L126.16-25.82C127.94-26.81 127.98-30.02 121.82-30.41L121.53-30.20C122.35-29.24 123.24-27.60 123.42-26.14C123.60-25.99 123.78-25.89 123.92-25.82L108.11-25.82L108.39-24.82L140.41-24.82C140.94-24.82 141.30-25.00 141.40-25.39C139.73-26.81 136.92-28.88 136.92-28.88ZM171.39-22.75L169.47-22.75C169.43-24.61 169.47-26.46 169.50-28.27C169.71-28.31 169.89-28.35 170.07-28.38C170.93-27.49 171.96-25.99 172.28-24.64C172.42-24.53 172.56-24.46 172.71-24.43ZM161.38-15.24C161.27-9.65 161.10-7.02 160.60-6.37C160.46-6.20 160.31-6.12 160.03-6.12C159.57-6.12 158.32-6.20 157.39-6.27C158.39-9.26 158.57-12.32 158.57-14.99L158.57-15.24ZM150.98-19.12L154.69-19.12L154.76-19.12L154.76-14.99C154.76-13.53 154.72-12.07 154.62-10.58C153.37-10.18 152.16-9.83 150.98-9.47ZM177.12-7.41L176.73-7.48C176.16-5.98 175.38-4.27 174.91-3.38C174.56-2.74 174.38-2.71 173.99-3.31C173.06-4.56 172.31-6.02 171.71-7.62C173.24-10.15 174.52-13.07 175.59-16.49C176.52-16.45 176.87-16.67 177.05-17.13L172.31-18.73C171.78-16.34 171.14-14.21 170.43-12.25C169.86-15.21 169.61-18.45 169.50-21.76L176.12-21.76C176.62-21.76 176.98-21.94 177.09-22.29C176.34-22.97 175.30-23.82 174.52-24.43C176.27-25.28 176.34-28.59 170.53-28.70C170.71-28.88 170.78-29.06 170.78-29.27L165.62-29.81C165.62-27.38 165.65-25.03 165.73-22.75L159.17-22.75L154.76-24.36L154.76-20.69C153.76-21.83 152.66-22.97 152.66-22.97L150.98-20.19L150.98-28.13C151.95-28.27 152.23-28.63 152.30-29.13L147.07-29.59L147.07-20.12L143.61-20.12L143.90-19.12L147.07-19.12L147.07-8.30C145.39-7.83 144.00-7.44 143.15-7.26L145.32-2.53C145.71-2.67 146.07-3.06 146.21-3.56C149.88-6.05 152.62-8.15 154.51-9.69C154.05-5.31 152.73-0.96 149.24 2.71L149.60 3.06C153.94 0.57 156.18-2.71 157.36-6.12L157.36-5.80C158.32-5.56 159.14-5.09 159.53-4.59C159.89-4.17 159.99-3.35 159.99-2.60C161.24-2.60 162.31-2.85 163.16-3.49C164.55-4.66 164.76-7.80 164.91-14.71C165.58-14.81 166.05-15.06 166.26-15.35L162.91-18.09L161.06-16.27L158.57-16.27L158.57-21.76L165.80-21.76C166.05-16.38 166.62-11.40 167.97-6.98C165.73-3.10 162.81-0.18 159.07 2.28L159.39 2.81C163.34 1.07 166.51-1.10 169.04-3.99C169.68-2.46 170.43-1.00 171.35 0.36C172.46 1.99 175.02 3.88 176.84 2.64C177.51 2.17 177.30 0.89 176.34-1.35Z" transform="translate(-0.53414068539036, 30.410409688225)"></path>
    </div>
    <div>
        <p>
          <font color="aqua" size="4px">管理员:{{uname}}</font>
            <a href="/face_pay/"><input type="button" value="刷脸支付"></a>
            <a href="/face_analyze/"><input type="button" value="表情识别"></a>
            <a href="/addin_"><input type="button" value="增加用户"></a>
            <a href="/">注销</a>
        </div>
    </div>
    <div>
    <table border="1">
        <tr>
            <th colspan="7">用户信息表</th>
        </tr>
        <tr>
            <th>用户名</th>
            <th>密码</th>
            <th>电子邮箱</th>
            <th>姓名</th>
            <th>身份证号</th>
            <th>图像</th>
            <th>操作</th>
        </tr>
            {% for i in m_data %}
                <tr>

                    <td>{{ i.username }}</td>
                    <td>{{ i.userpass }}</td>
                    <td>{{ i.useremail }}</td>
                    <td>{{ i.uname }}</td>
                    <td>{{ i.usernumber }}</td>
                    <td>
<!--                        <div id="div_img">-->
                            <img id="img_show" src="{{i.userimg}}" height="90" width="120">
<!--data:image/jpeg;base64,-->
<!--                        </div>-->
                    </td>

                    <td>

                        <input type="file" id="file_input" onchange="up_img({{i.id}},files)">


                        <a href="/updetint_?id={{i.id}}"><input type="button" value="修改"></a>
                        <input type="button" value="删除" onclick="del({{ i.id }})">

                    </td>
                </tr>
            {% endfor %}
    </table>
    </div>
</body>
<script>
    $.ajaxSetup({
        data:{csrfmiddlewaretoken:'{{ csrf_token }}'}
    })
///////////////////////////////////////////////
function up_img(id,files){
<!--    alert(id)-->
    var file = files[0];

   if (window.FileReader) {    
            var reader = new FileReader();    
            reader.readAsDataURL(file);    
          
          reader.onloadend = function (e) {
               alert(e.target.result)
<!--                alert(type(e.target.result)-->
<!--                base_data = e.target.result-->
                base_data=e.target.result.split(',')[1];

                base_data = base_data.toString()

                    $.ajax({
                        url:"/up_img/",
                        type:"post",
                        data:{
                        "id":id,
                        "img_data":base_data

                    },
                        success: function (data) {
                        alert('ok')

                            window.location ='http://localhost:8888/menu/';

<!--                            window.location ='http://localhost:8889/menu/';-->

<!--                         $("#img_show").attr('src',"{{i.userimg}}");-->

                        }
                    })

            };    
       }

}


//////////////////////////////////////////////////////


    function del(id){
        alert(id)
         $.ajax({
            url:"/del_/",
            type:"post",
            data:{
                "id":id,
            },
            success: function () {

                window.location ='http://localhost:8888/menu/';
            }
        })
    }
    $.ajaxSetup({
        data:{csrfmiddlewaretoken:'{{ csrf_token }}'}
    })

</script>
</html>